//项目模块
import {getProject} from "@/api";


export default {
    namespaced:true,//开启命名空间
    state:{
        loading:false,
        data:[]
    },
    mutations:{
        setLoading(state,payload){
            state.loading = payload;
        },
        setData(state,payload){
            state.data = payload;
        }
    },
    actions:{
       async fetchProject(ctx){
         ctx.commit('setLoading',true);
         const resp = await getProject();
         ctx.commit('setData',resp);
         ctx.commit('setLoading',false);
        }
    }
}